;; -*- Emacs-Lisp -*-

;; Time-stamp: <2012-04-16 09:49:19 Monday by xq>

(defun woman-settings ()
  "Settings for `woman-mode'."
  (setq woman-use-own-frame nil)
  (setq woman-fill-column 100)

  (defun woman-mode-hook-settings ()
    "Settings for `woman-mode'."
    (setq truncate-lines nil))

  ;; woman face settings
  (defun woman-face-settings ()
  "Face settings for `woman'."
  (set-face-foreground 'woman-italic "green")
  (set-face-foreground 'woman-bold "red")
  (custom-set-faces
   '(woman-bold
     ((((class color)) :foreground "red" :bold nil))))
  (set-face-foreground 'woman-addition "yellow")
  (set-face-foreground 'woman-unknown "blue"))

  (woman-face-settings)

  (add-hook 'woman-mode-hook 'woman-mode-hook-settings)
  ;; 只增加英文的man路径
  (setq woman-manpath
        (or (woman-parse-colon-path (getenv "MANPATH"))
            '("/usr/man" "/usr/share/man" "/usr/local/man")))
  
)

(eal-define-keys
 'woman-mode-map
 `(("t"     sb-toggle-keep-buffer)))

(defun woman-current-word ()
  "查看当前光标所在的词的`man'"
  (interactive)
  (woman (current-word)))

(eval-after-load "woman"
  '(woman-settings))

(global-set-key "\C-cm" 'woman)

(provide 'init-woman)
